//
//  SinaPictureCell.swift
//  mySina
//
//  Created by 刘莹 on 2016/11/18.
//  Copyright © 2016年 liuying. All rights reserved.
//

import UIKit

class SinaPictureCell: UICollectionViewCell {
    //缩略图片
    @IBOutlet weak var imageView: UIImageView!
    //gif图标
    @IBOutlet weak var gifIcon: UIImageView!
    var pictureInfo: SinaPictureInfo? {
        didSet {
            //1.设置缩略图片url
            let url = URL(string: pictureInfo?.thumbnail_pic ?? "")
            imageView.sd_setImage(with: url)
            //2.设置gif图标显示或隐藏
            self.gifIcon.isHidden = !pictureInfo!.thumbnail_pic!.hasSuffix(".gif")
        }
    }

}
